package com.itheima.dao;

import com.itheima.pojo.Member;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface OrderMapper {

	@Select("select * from t_order where id=#{id}")
	Order findById(Integer id);

	/**
	 * 根据手机号查询用户信息
	 *
	 * @param telephone
	 */
	@Select("select * from t_member where phoneNumber=#{telephone}")
	Member findByPhone(String telephone);

	/**
	 * 添加会员信息
	 *
	 * @param member1
	 */
	void add(Member member1);

	/**
	 * 添加预约信息
	 *
	 * @param order
	 * @return
	 */
	@Insert("insert into t_order(id,memberId,orderDate,orderType,orderStatus,setmealId) values(#{id},#{memberId},#{orderDate},#{orderType},#{orderStatus},#{setmealId})")
	Integer insert(Order order);
}
